package com.city.service.report.impl;

import com.city.domain.auth.format.CtBranchFormat;
import com.city.domain.report.CtBranch;
import com.city.repository.report.CtBranchFormatRepository;
import com.city.repository.report.CtBranchRepository;
import com.city.service.report.CtBranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CtBranchServiceImpl implements CtBranchService {
    @Autowired
    private CtBranchRepository ctBranchRepository;


    @Override
    public List<CtBranch> findAll() {
        return ctBranchRepository.findAll();
    }

    @Override
    public List<CtBranch> findByPageAndLimit(Integer page, Integer limt) {
        return ctBranchRepository.findByPageAndLimit((page-1)*limt,limt);
    }

    @Override
    public long count() {
        return ctBranchRepository.count();
    }

    @Override
    public CtBranch findById(int id) {
        return ctBranchRepository.findById(id);
    }

    @Override
    public void save(CtBranch ctBranch) {
        ctBranchRepository.save(ctBranch);
    }

    @Override
    public void delete(int id) {
        ctBranchRepository.delete(id);
    }


}
